package com.woniu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.pojo.Menu;
import com.woniu.pojo.Subject;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 会员表 Mapper 接口
 * </p>
 *
 * @author xiaotang
 * @since 2025-02-14
 */
public interface SubjectMapper extends BaseMapper<Subject> {

    @Select("select * from wnxt_subject where title = #{oneTitle} and parent_id = 0")
    Subject isExistsParent(String oneTitle);

    @Select("select * from wnxt_subject where title = #{towTitle} and parent_id != 0")
    Subject isExistsSecond(String towTitle);

    /**
     * 查询课程分类
     */
    @Select("select title from wnxt_subject where parent_id = 0" )
    List<Subject> listSubjectByClassify();

    @Select("select * from wnxt_subject where parent_id != 0")
    List<Subject> listIndexTwo();
}